this.BX=this.BX||{};this.BX.UI=this.BX.UI||{};(function(e,s,i,t){"use strict";let l=e=>e,a,r,o,n,d;var b=babelHelpers.classPrivateFieldLooseKey("id");var c=babelHelpers.classPrivateFieldLooseKey("title");var h=babelHelpers.classPrivateFieldLooseKey("description");var p=babelHelpers.classPrivateFieldLooseKey("className");var v=babelHelpers.classPrivateFieldLooseKey("image");var u=babelHelpers.classPrivateFieldLooseKey("videoUrl");var P=babelHelpers.classPrivateFieldLooseKey("videoIframe");var B=babelHelpers.classPrivateFieldLooseKey("videoHtmlElement");var y=babelHelpers.classPrivateFieldLooseKey("videoOptions");var F=babelHelpers.classPrivateFieldLooseKey("videoPlayPromise");var H=babelHelpers.classPrivateFieldLooseKey("autoplay");var L=babelHelpers.classPrivateFieldLooseKey("html");var g=babelHelpers.classPrivateFieldLooseKey("cache");var m=babelHelpers.classPrivateFieldLooseKey("setVideo");class f{constructor(e){Object.defineProperty(this,m,{value:w});Object.defineProperty(this,b,{writable:true,value:""});Object.defineProperty(this,c,{writable:true,value:""});Object.defineProperty(this,h,{writable:true,value:""});Object.defineProperty(this,p,{writable:true,value:""});Object.defineProperty(this,v,{writable:true,value:null});Object.defineProperty(this,u,{writable:true,value:null});Object.defineProperty(this,P,{writable:true,value:null});Object.defineProperty(this,B,{writable:true,value:null});Object.defineProperty(this,y,{writable:true,value:null});Object.defineProperty(this,F,{writable:true,value:null});Object.defineProperty(this,H,{writable:true,value:false});Object.defineProperty(this,L,{writable:true,value:null});Object.defineProperty(this,g,{writable:true,value:new t.Cache.MemoryCache});e=t.Type.isPlainObject(e)?e:{};babelHelpers.classPrivateFieldLooseBase(this,b)[b]=t.Type.isStringFilled(e.id)?e.id:babelHelpers.classPrivateFieldLooseBase(this,b)[b];babelHelpers.classPrivateFieldLooseBase(this,p)[p]=t.Type.isStringFilled(e.className)?e.className:babelHelpers.classPrivateFieldLooseBase(this,p)[p];babelHelpers.classPrivateFieldLooseBase(this,v)[v]=t.Type.isStringFilled(e.image)?e.image:babelHelpers.classPrivateFieldLooseBase(this,v)[v];babelHelpers.classPrivateFieldLooseBase(this,c)[c]=t.Type.isStringFilled(e.title)?e.title:babelHelpers.classPrivateFieldLooseBase(this,c)[c];babelHelpers.classPrivateFieldLooseBase(this,h)[h]=t.Type.isStringFilled(e.description)?e.description:babelHelpers.classPrivateFieldLooseBase(this,h)[h];babelHelpers.classPrivateFieldLooseBase(this,m)[m](e.video);babelHelpers.classPrivateFieldLooseBase(this,H)[H]=t.Type.isBoolean(e.autoplay)?e.autoplay:babelHelpers.classPrivateFieldLooseBase(this,H)[H];if(t.Type.isElementNode(e.html)||t.Type.isStringFilled(e.html)){babelHelpers.classPrivateFieldLooseBase(this,L)[L]=e.html}}getId(){return babelHelpers.classPrivateFieldLooseBase(this,b)[b]}getTitle(){return babelHelpers.classPrivateFieldLooseBase(this,c)[c]}getDescription(){return babelHelpers.classPrivateFieldLooseBase(this,h)[h]}getBullet(){return babelHelpers.classPrivateFieldLooseBase(this,g)[g].remember("bullet",(()=>t.Tag.render(a||(a=l`<span class="ui-whats-new-bullet" title="${0}"></span>`),this.getTitle())))}getVideoIframe(){return babelHelpers.classPrivateFieldLooseBase(this,P)[P]}getVideoHtmlElement(){return babelHelpers.classPrivateFieldLooseBase(this,B)[B]}pauseVideo(){if(this.getVideoIframe()){this.getVideoIframe().contentWindow.postMessage(JSON.stringify({event:"command",func:"stopVideo"}),"*")}else if(this.getVideoHtmlElement()){if(babelHelpers.classPrivateFieldLooseBase(this,F)[F]){babelHelpers.classPrivateFieldLooseBase(this,F)[F].then((()=>{this.getVideoHtmlElement().pause();babelHelpers.classPrivateFieldLooseBase(this,F)[F]=null})).catch((()=>{}))}}}playVideo(){if(this.getVideoIframe()){this.getVideoIframe().contentWindow.postMessage(JSON.stringify({event:"command",func:"playVideo"}),"*")}else if(this.getVideoHtmlElement()){babelHelpers.classPrivateFieldLooseBase(this,F)[F]=this.getVideoHtmlElement().play()}}isVideo(){return babelHelpers.classPrivateFieldLooseBase(this,u)[u]!==null||babelHelpers.classPrivateFieldLooseBase(this,y)[y]!==null}isAutoplay(){return babelHelpers.classPrivateFieldLooseBase(this,H)[H]}getContainer(){return babelHelpers.classPrivateFieldLooseBase(this,g)[g].remember("container",(()=>{if(babelHelpers.classPrivateFieldLooseBase(this,u)[u]){babelHelpers.classPrivateFieldLooseBase(this,P)[P]=t.Tag.render(r||(r=l`<iframe 
						src="${0}" 
						id="${0}" 
						class="ui-whats-new-slide-item ${0}" 
						frameborder="0"
						allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" 
						allowfullscreen></iframe>
				`),babelHelpers.classPrivateFieldLooseBase(this,u)[u],babelHelpers.classPrivateFieldLooseBase(this,b)[b],babelHelpers.classPrivateFieldLooseBase(this,p)[p]);return babelHelpers.classPrivateFieldLooseBase(this,P)[P]}else if(babelHelpers.classPrivateFieldLooseBase(this,y)[y]){const e=[];babelHelpers.classPrivateFieldLooseBase(this,y)[y].sources.forEach((s=>{e.push(`<source src="${s.src}" type="${s.type}" />`)}));babelHelpers.classPrivateFieldLooseBase(this,B)[B]=t.Tag.render(o||(o=l`<video>${0}</video>`),e.join(""));if(t.Type.isPlainObject(babelHelpers.classPrivateFieldLooseBase(this,y)[y].attrs)){t.Dom.attr(babelHelpers.classPrivateFieldLooseBase(this,B)[B],babelHelpers.classPrivateFieldLooseBase(this,y)[y].attrs)}return t.Tag.render(n||(n=l`
						<div 
							id="${0}" 
							class="ui-whats-new-slide-item ${0}"
						>${0}</div>`),babelHelpers.classPrivateFieldLooseBase(this,b)[b],babelHelpers.classPrivateFieldLooseBase(this,p)[p],babelHelpers.classPrivateFieldLooseBase(this,B)[B])}else{var e;return t.Tag.render(d||(d=l`<div 
						id="${0}" 
						class="ui-whats-new-slide-item ${0}" 
						${0}>${0}</div>`),babelHelpers.classPrivateFieldLooseBase(this,b)[b],babelHelpers.classPrivateFieldLooseBase(this,p)[p],babelHelpers.classPrivateFieldLooseBase(this,v)[v]?'style="background-image: url('+babelHelpers.classPrivateFieldLooseBase(this,v)[v]+')"':"",(e=babelHelpers.classPrivateFieldLooseBase(this,L)[L])!=null?e:"")}}))}}function w(e){if(t.Type.isStringFilled(e)){const s=new URL(e);if(s.host.includes("youtube")){s.searchParams.append("enablejsapi","1")}babelHelpers.classPrivateFieldLooseBase(this,u)[u]=s.toString()}else if(t.Type.isPlainObject(e)&&t.Type.isArrayFilled(e.sources)){babelHelpers.classPrivateFieldLooseBase(this,y)[y]=e}}let S=e=>e,C,O,T,D,j,K,$,x;var E=babelHelpers.classPrivateFieldLooseKey("popup");var V=babelHelpers.classPrivateFieldLooseKey("slides");var N=babelHelpers.classPrivateFieldLooseKey("cache");var I=babelHelpers.classPrivateFieldLooseKey("position");var M=babelHelpers.classPrivateFieldLooseKey("popupOptions");var X=babelHelpers.classPrivateFieldLooseKey("documentKeyDownHandler");var k=babelHelpers.classPrivateFieldLooseKey("destroying");var A=babelHelpers.classPrivateFieldLooseKey("bindEvents");var U=babelHelpers.classPrivateFieldLooseKey("unbindEvents");var W=babelHelpers.classPrivateFieldLooseKey("handleDocumentKeyDown");var q=babelHelpers.classPrivateFieldLooseKey("handleBulletClick");var J=babelHelpers.classPrivateFieldLooseKey("handlePopupShow");var R=babelHelpers.classPrivateFieldLooseKey("handlePopupClose");var z=babelHelpers.classPrivateFieldLooseKey("handlePopupDestroy");class G extends s.EventEmitter{constructor(e){super();Object.defineProperty(this,z,{value:ie});Object.defineProperty(this,R,{value:se});Object.defineProperty(this,J,{value:ee});Object.defineProperty(this,q,{value:_});Object.defineProperty(this,W,{value:Z});Object.defineProperty(this,U,{value:Y});Object.defineProperty(this,A,{value:Q});Object.defineProperty(this,E,{writable:true,value:null});Object.defineProperty(this,V,{writable:true,value:[]});Object.defineProperty(this,N,{writable:true,value:new t.Cache.MemoryCache});Object.defineProperty(this,I,{writable:true,value:null});Object.defineProperty(this,M,{writable:true,value:{}});this.infinityLoop=false;Object.defineProperty(this,X,{writable:true,value:null});Object.defineProperty(this,k,{writable:true,value:false});this.setEventNamespace("BX.UI.Dialogs.WhatsNew");e=t.Type.isPlainObject(e)?e:{};if(!t.Type.isArrayFilled(e.slides)){throw new Error('NewStructurePopup: "items" parameter is required.')}e.slides.forEach((e=>{babelHelpers.classPrivateFieldLooseBase(this,V)[V].push(new f(e))}));if(t.Type.isPlainObject(e.popupOptions)){babelHelpers.classPrivateFieldLooseBase(this,M)[M]=e.popupOptions}if(t.Type.isBoolean(e.infinityLoop)){this.infinityLoop=e.infinityLoop}babelHelpers.classPrivateFieldLooseBase(this,X)[X]=babelHelpers.classPrivateFieldLooseBase(this,W)[W].bind(this);this.subscribeFromOptions(e.events)}getPopup(){if(babelHelpers.classPrivateFieldLooseBase(this,E)[E]!==null){return babelHelpers.classPrivateFieldLooseBase(this,E)[E]}babelHelpers.classPrivateFieldLooseBase(this,E)[E]=new i.Popup(Object.assign({className:"ui-whats-new-popup",closeIcon:false,closeByEsc:true,overlay:true,cacheable:false,animation:"scale",content:this.getContentContainer(),width:720,height:530,autoHide:true},babelHelpers.classPrivateFieldLooseBase(this,M)[M]));babelHelpers.classPrivateFieldLooseBase(this,E)[E].subscribe("onDestroy",babelHelpers.classPrivateFieldLooseBase(this,z)[z].bind(this));babelHelpers.classPrivateFieldLooseBase(this,E)[E].subscribe("onShow",babelHelpers.classPrivateFieldLooseBase(this,J)[J].bind(this));babelHelpers.classPrivateFieldLooseBase(this,E)[E].subscribe("onClose",babelHelpers.classPrivateFieldLooseBase(this,R)[R].bind(this));this.selectSlide();return babelHelpers.classPrivateFieldLooseBase(this,E)[E]}getCurrentSlide(){return babelHelpers.classPrivateFieldLooseBase(this,V)[V][babelHelpers.classPrivateFieldLooseBase(this,I)[I]]}getSlides(){return babelHelpers.classPrivateFieldLooseBase(this,V)[V]}getSlideByPosition(e){var s;return(s=babelHelpers.classPrivateFieldLooseBase(this,V)[V][e])!=null?s:null}getPositionBySlide(e){for(let s=0;s<babelHelpers.classPrivateFieldLooseBase(this,V)[V].length;s++){const i=babelHelpers.classPrivateFieldLooseBase(this,V)[V][s];if(i===e){return s}}return null}getFirstPosition(){return 0}getLastPosition(){return babelHelpers.classPrivateFieldLooseBase(this,V)[V].length-1}getContentContainer(){return babelHelpers.classPrivateFieldLooseBase(this,N)[N].remember("content",(()=>t.Tag.render(C||(C=S`
				<div class="ui-whats-new-content"> 
					${0}
					<div class="ui-whats-new-slide-wrap"> 
						${0} 
						${0} 
						<div class="ui-whats-new-slide-inner">${0}</div>  
					</div> 
					${0}
					<div class="ui-whats-new-close-btn" onclick="${0}"></div>
				</div>
			`),this.getHeadContainer(),this.getPrevBtn(),this.getNextBtn(),this.getSliderBox(),this.getBulletBox(),this.hide.bind(this))))}getHeadContainer(){return babelHelpers.classPrivateFieldLooseBase(this,N)[N].remember("head",(()=>t.Tag.render(O||(O=S`
				<div class="ui-whats-new-head"> 
					${0}
					${0}
				</div>
			`),this.getTitleContainer(),this.getDescContainer())))}getTitleContainer(){return babelHelpers.classPrivateFieldLooseBase(this,N)[N].remember("title",(()=>t.Tag.render(T||(T=S`<div class="ui-whats-new-title"></div>`))))}getDescContainer(){return babelHelpers.classPrivateFieldLooseBase(this,N)[N].remember("description",(()=>t.Tag.render(D||(D=S`<div class="ui-whats-new-desc"></div>`))))}getSliderBox(){return babelHelpers.classPrivateFieldLooseBase(this,N)[N].remember("sliderBox",(()=>t.Tag.render(j||(j=S`<div class="ui-whats-new-slide-box">${0}</div>`),babelHelpers.classPrivateFieldLooseBase(this,V)[V].map((e=>e.getContainer())))))}getBulletBox(){return babelHelpers.classPrivateFieldLooseBase(this,N)[N].remember("bulletBox",(()=>this.isMoreThan1Slide()?t.Tag.render(K||(K=S`<div class="ui-whats-new-bullet-box" onclick="${0}">${0}</div>`),babelHelpers.classPrivateFieldLooseBase(this,q)[q].bind(this),babelHelpers.classPrivateFieldLooseBase(this,V)[V].map((e=>e.getBullet()))):null))}getPrevBtn(){return babelHelpers.classPrivateFieldLooseBase(this,N)[N].remember("prevBtn",(()=>t.Tag.render($||($=S`
				<div 
					class="ui-whats-new-slide-btn --btn-prev" 
					onclick="${0}">
				</div>`),this.selectPrevSlide.bind(this))))}getNextBtn(){return babelHelpers.classPrivateFieldLooseBase(this,N)[N].remember("nextBtn",(()=>t.Tag.render(x||(x=S`
				<div 
					class="ui-whats-new-slide-btn --btn-next" 
					onclick="${0}">
				</div>
			`),this.selectNextSlide.bind(this))))}isMoreThan1Slide(){return babelHelpers.classPrivateFieldLooseBase(this,V)[V].length>1}show(){this.getPopup().show()}hide(){this.getPopup().close()}destroy(){if(babelHelpers.classPrivateFieldLooseBase(this,k)[k]){return}babelHelpers.classPrivateFieldLooseBase(this,k)[k]=true;this.emit("onDestroy");babelHelpers.classPrivateFieldLooseBase(this,U)[U]();this.getPopup().destroy();for(const e in this){if(this.hasOwnProperty(e)){delete this[e]}}Object.setPrototypeOf(this,null)}selectPrevSlide(){if(this.infinityLoop&&babelHelpers.classPrivateFieldLooseBase(this,I)[I]===this.getFirstPosition()){this.selectSlide(this.getLastPosition())}else{this.selectSlide(babelHelpers.classPrivateFieldLooseBase(this,I)[I]-1)}}selectNextSlide(){if(this.infinityLoop&&babelHelpers.classPrivateFieldLooseBase(this,I)[I]===this.getLastPosition()){this.selectSlide(this.getFirstPosition())}else{this.selectSlide(babelHelpers.classPrivateFieldLooseBase(this,I)[I]+1)}}selectSlide(e=0){const i=this.getFirstPosition();const l=this.getLastPosition();e=Math.min(Math.max(e,i),l);if(babelHelpers.classPrivateFieldLooseBase(this,I)[I]===e){return}const a=this.getSlideByPosition(babelHelpers.classPrivateFieldLooseBase(this,I)[I]);const r=this.getSlideByPosition(e);const o=new s.BaseEvent({data:{currentSlide:a,newSlide:r}});this.emit("Slide:onBeforeSelect",o);if(o.isDefaultPrevented()){return}babelHelpers.classPrivateFieldLooseBase(this,I)[I]=e;if(!this.isMoreThan1Slide()){t.Dom.addClass(this.getPrevBtn(),"--hide");t.Dom.addClass(this.getNextBtn(),"--hide")}else if(!this.infinityLoop){if(e===i){t.Dom.addClass(this.getPrevBtn(),"--hide");t.Dom.removeClass(this.getNextBtn(),"--hide")}else if(e===l){t.Dom.removeClass(this.getPrevBtn(),"--hide");t.Dom.addClass(this.getNextBtn(),"--hide")}else{t.Dom.removeClass(this.getPrevBtn(),"--hide");t.Dom.removeClass(this.getNextBtn(),"--hide")}}t.Dom.style(this.getSliderBox(),{transform:"translateX("+-e*this.getSliderBox().offsetWidth+"px)"});babelHelpers.classPrivateFieldLooseBase(this,V)[V].forEach(((s,i)=>{if(e===i){t.Dom.addClass(s.getBullet(),"--active")}else{t.Dom.removeClass(s.getBullet(),"--active")}}));t.Dom.style(this.getHeadContainer(),{opacity:0,transition:"none"});const n=r.getTitle().trim();const d=r.getDescription().trim();if(t.Type.isStringFilled(n)){t.Dom.removeClass(this.getContentContainer(),"--empty-head");if(t.Type.isStringFilled(d)){t.Dom.removeClass(this.getContentContainer(),"--empty-desc")}else{t.Dom.addClass(this.getContentContainer(),"--empty-desc")}}else{t.Dom.addClass(this.getContentContainer(),"--empty-head")}this.getTitleContainer().innerHTML=n;this.getDescContainer().innerHTML=d;const b=()=>{this.getSlides().forEach((e=>{if(this.getCurrentSlide()!==e){t.Dom.style(e.getContainer(),"opacity",null);e.pauseVideo()}}));t.Dom.style(this.getHeadContainer(),"opacity",null)};if(r.isVideo()&&r.isAutoplay()){r.playVideo()}setTimeout(b,700);requestAnimationFrame((()=>{requestAnimationFrame((()=>{if(a){t.Dom.style(a.getContainer(),"opacity",0)}t.Dom.style(r.getContainer(),"opacity",1);t.Dom.style(this.getHeadContainer(),"opacity",1);t.Dom.style(this.getHeadContainer(),"transition",null)}))}));this.emit("Slide:onSelect",{slide:r})}}function Q(){t.Event.bind(document,"keydown",babelHelpers.classPrivateFieldLooseBase(this,X)[X])}function Y(){t.Event.unbind(document,"keydown",babelHelpers.classPrivateFieldLooseBase(this,X)[X])}function Z(e){if(!this.getPopup().isShown()){babelHelpers.classPrivateFieldLooseBase(this,U)[U]();return}if(e.metaKey||e.ctrlKey||e.altKey){return}if(e.key==="ArrowLeft"){this.selectPrevSlide()}else if(e.key==="ArrowRight"){this.selectNextSlide()}}function _(e){const s=this.getSlides().find((s=>e.target===s.getBullet()));const i=this.getPositionBySlide(s);if(i!==null){this.selectSlide(i)}}function ee(){babelHelpers.classPrivateFieldLooseBase(this,A)[A]();this.emit("onShow")}function se(){babelHelpers.classPrivateFieldLooseBase(this,U)[U]();this.getSlides().forEach((e=>{e.pauseVideo()}));this.emit("onHide")}function ie(){this.getSlides().forEach((e=>{e.pauseVideo()}));this.destroy()}e.WhatsNew=G;e.Slide=f})(this.BX.UI.Dialogs=this.BX.UI.Dialogs||{},BX.Event,BX.Main,BX);
//# sourceMappingURL=whats-new.bundle.map.js